import base64

def encode(filepath_in, filepath_out):
    with open(filepath_in, "rb") as _in:
        with open(filepath_out, 'wb') as _out:
            base64.encode(_in, _out)

def decode(filepath_in, filepath_out):
    with open(filepath_in, "rb") as _in:
        with open(filepath_out, 'wb') as _out:
            base64.decode(_in, _out)

# encode('/media/Projects/Company/php/dedecms/ppz/phpenv.docker', '/tmp/ssfg.grh')
# decode('/tmp/ssfg.grh', '/tmp/phpenv.docker')

encode('/media/sf_Administrator/Downloads/dede.tgz', '/media/sf_Administrator/Downloads/dede.tgz.txt')
